﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace QMERP.Infrastructure.EFCore.Migrations
{
    /// <inheritdoc />
    public partial class init13 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_CreatedOn",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_FactoryLensCode",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_FactoryLensName",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_LensType",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_ProductType",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_SalesLensCode",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_SalesLensName",
            //    table: "Lens");

            //migrationBuilder.DropIndex(
            //    name: "IX_Lens_Type",
            //    table: "Lens");

            migrationBuilder.AlterColumn<string>(
                name: "SalesLensName",
                table: "Lens",
                type: "nvarchar(400)",
                maxLength: 400,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(800)",
                oldMaxLength: 800);

            migrationBuilder.AlterColumn<string>(
                name: "FactoryLensCode",
                table: "Lens",
                type: "nvarchar(400)",
                maxLength: 400,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(200)",
                oldMaxLength: 200);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "SalesLensName",
                table: "Lens",
                type: "nvarchar(800)",
                maxLength: 800,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(400)",
                oldMaxLength: 400);

            migrationBuilder.AlterColumn<string>(
                name: "FactoryLensCode",
                table: "Lens",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(400)",
                oldMaxLength: 400);

            migrationBuilder.CreateIndex(
                name: "IX_Lens_CreatedOn",
                table: "Lens",
                column: "CreatedOn",
                descending: new bool[0]);

            migrationBuilder.CreateIndex(
                name: "IX_Lens_FactoryLensCode",
                table: "Lens",
                column: "FactoryLensCode");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_FactoryLensName",
                table: "Lens",
                column: "FactoryLensName");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_LensType",
                table: "Lens",
                column: "LensType");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_ProductType",
                table: "Lens",
                column: "ProductType");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_SalesLensCode",
                table: "Lens",
                column: "SalesLensCode");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_SalesLensName",
                table: "Lens",
                column: "SalesLensName");

            migrationBuilder.CreateIndex(
                name: "IX_Lens_Type",
                table: "Lens",
                column: "Type");
        }
    }
}
